package com.itheima.springbootwebtlias.mapper;


import com.itheima.springbootwebtlias.pojo.Dept;
import org.apache.ibatis.annotations.*;

import java.util.Date;
import java.util.List;

/**
 * 部门持久层接口：处理部门相关持久层接口
 */
@Mapper
public interface DeptMapper {

    @Select("select * from dept;")
    List<Dept> selectAllDept();


    @Delete("delete  from dept where id = #{id}")
    void removeById(Integer id);


    @Insert("insert into dept (id, name, create_time, update_time) values (null,#{name},#{createTime},#{updateTime});")
    void addDept(Dept dept);


    @Select("select * from dept where id = #{id};")
    Dept selectById(Integer id);

    @Update("update dept set name = #{name} , update_time = #{updateTime} where id = #{id};")
    void updateById(Dept dept);
}
